/*
 *@Description: 校验类
 *@Author:  lupan
 *@Date: 2019-07-14 17:25:57
*/

const check = {
  /*
   *@Description: 校验字符长度
   *@params: str：字符  length：默认为4
   *@Author:  lupan
   *@Date: 2019-07-14 17:26:43
  */
  strLength: (str, length = 4) => {
    return str.length > length ? false : true
  },
  /*
   *@Description: 数据是否为数组类型
   *@params: 
   *@Author:  lupan
   *@Date: 2019-07-15 13:30:26
  */
  isArray: (arr) => {
    return Object.prototype.toString.call(arr) === '[object Array]'
  },
  /*
   *@Description: 数据是否为对象类型
   *@params: 
   *@Author:  lupan
   *@Date: 2019-07-15 13:30:57
  */
  isObject: (obj) => {
    return Object.prototype.toString.call(obj) === '[object Object]'
  }
}

module.exports = check